<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style lang="css">
    .scan {
      width: 150px;
      height: 150px;
      margin: 30px auto;
      position: relative;
      background: linear-gradient(to left, #108EE9, #108EE9) left top no-repeat, linear-gradient(to bottom, #108EE9, #108EE9) left top no-repeat, linear-gradient(to left, #108EE9, #108EE9) right top no-repeat, linear-gradient(to bottom, #108EE9, #108EE9) right top no-repeat, linear-gradient(to left, #108EE9, #108EE9) left bottom no-repeat, linear-gradient(to bottom, #108EE9, #108EE9) left bottom no-repeat, linear-gradient(to left, #108EE9, #108EE9) right bottom no-repeat, linear-gradient(to left, #108EE9, #108EE9) right bottom no-repeat;
      background-size: 3px 20px, 20px 3px, 3px 20px, 20px 3px;
    }

    .scan::after {
      content: '';
      width: 140px;
      border: 1px solid #BBE2FF;
      position: absolute;
      left: 5px;
      top: 2px;
      animation: myfirst 4s infinite;
    }

    @keyframes myfirst {
      from {
        top: 2px;
      }

      to {
        top: 144px;
      }
    }
  </style>
</head>

<body>
  <div class="scan"></div>
</body>

</html>